home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 265_01 / environ.h < prev    next >
Text File  |  1990-02-13  |  4KB  |  226 lines

  1. /*
  2.  *    e n v i r o n . h
  3.  *    -----------------
  4.  *    This module contains environment specific information. It is
  5.  *    used to make the programs more portable.
  6.  *
  7.  *    @(#)Copyrigth (C) by Rainer Gerhards. All rights reserved.
  8.  */
  9. #ifndef    ENVIRON_H
  10. #define    ENVIRON_H
  11.  
  12. /*
  13.  *    configurable parameters.
  14.  *    modify the following parameters according to the targe environment.
  15.  */
  16.  
  17. /*
  18.  *    define target operating system
  19.  */
  20. #define    MSDOS        1
  21. #define    UNIX        0
  22. #define    STARSYS        0
  23.  
  24. /*
  25.  *    define target machine
  26.  *
  27.  *    This is auxiluary data only needed for some operating
  28.  *    systems. Currently only needed if MS-DOS is active.
  29.  */
  30. #define    IBM_PC        1        /* IBM PC, XT, AT & compatibels    */
  31. #define    WANG_PC        0        /* Wang PC, APC ...        */
  32.  
  33. /*
  34.  *    define target compiler (if neccessary)
  35.  */
  36. #define    MSC        1        /* Microsoft C            */
  37.  
  38. #define    AUTO_SEL    1
  39. /*
  40.  * The above #define allowes an automatic language set selection. It is
  41.  * only functional if the used compiler identifies itself via a #define.
  42.  *
  43.  * Note: If AUTO_SEL is set, the parameters below are meaningless!
  44.  */
  45.  
  46. #define    USE_FAR        0        /* use far keyword        */
  47. #define    USE_NEAR    0        /* use near keyword        */
  48. #define    USE_VOID    1        /* use void keyword        */
  49. #define    USE_VOLA    0        /* use volatile keyword        */
  50. #define    USE_CONST    0        /* use const keyword        */
  51. #define    USE_PROTT    0        /* use function prototypes    */
  52. #define    USE_INTR    0        /* use interrupt keyword    */
  53.  
  54. /*    +----------------------------------------------------------------+
  55.  *    |                  End Of Configurable Parameters                |
  56.  *    +----------------------------------------------------------------+
  57.  *    Please do not make any changes below this point!
  58.  */
  59.  
  60. #ifndef    SYMDEB
  61. # define    SYMDEB        0
  62. #endif
  63.  
  64. /*
  65.  *    Check target compiler. Note that the MSC switch is overriden if
  66.  *    either __TURBOC__ or DLC are defined.
  67.  */
  68. #ifdef    __TURBOC__
  69. # undef    MSC
  70. #endif
  71. #ifdef    DLC
  72. # undef    MSC
  73. #endif
  74. #if    STARSYS
  75. # undef MSC
  76. #endif
  77.  
  78. #if    !MSDOS
  79. # undef MSC
  80. # undef    AUTO_SEL
  81. # define    AUTO_SEL    0
  82. #endif
  83.  
  84. #if    AUTO_SEL
  85. #  undef    USE_FAR
  86. #  undef    USE_NEAR
  87. #  undef    USE_VOID
  88. #  undef    USE_VOLA
  89. #  undef    USE_CONST
  90. #  undef    USE_PROTT
  91. #  undef    USE_INTR
  92. #  ifdef    __TURBOC__
  93. #    define    USE_FAR        1
  94. #    define    USE_NEAR    1
  95. #    define    USE_VOID    1
  96. #    define    USE_VOLA    1
  97. #    define    USE_CONST    1
  98. #    define    USE_PROTT    1
  99. #    define    USE_INTR    1
  100. #  endif
  101. #  ifdef    DLC
  102. #    define    USE_FAR        1
  103. #    define    USE_NEAR    1
  104. #    define    USE_VOID    1
  105. #    define    USE_VOLA    1
  106. #    define    USE_CONST    1
  107. #    define    USE_PROTT    1
  108. #    define    USE_INTR    0
  109. #  endif
  110. #  ifdef    MSC
  111. #    define    USE_FAR        1
  112. #    define    USE_NEAR    1
  113. #    define    USE_VOID    1
  114. #    define    USE_VOLA    1
  115. #    define    USE_CONST    1
  116. #    define    USE_PROTT    1
  117. #    define    USE_INTR    1
  118. #  endif
  119. #endif
  120.  
  121.  
  122. #if    !USE_FAR
  123. #define    far
  124. #endif
  125.  
  126. #if    !USE_NEAR
  127. #define    near
  128. #endif
  129.  
  130. #if    !USE_VOID
  131. #define    void
  132. #endif
  133.  
  134. #if    !USE_VOLA
  135. #define    volatile
  136. #endif
  137.  
  138. #if    !USE_CONST
  139. #define    const
  140. #endif
  141.  
  142. #if    USE_INTR
  143. # ifdef    MSC
  144. #   define    INTERRUPT interrupt far
  145. # else
  146. #   define    INTERRUPT interrupt
  147. # endif
  148. #else
  149. # define    INTERRUPT
  150. #endif
  151.  
  152. #if    USE_PROTT
  153. #  define    PROTT(x)    x
  154. #  ifdef MSC
  155. #    define    STATICPT(func, prott) static func prott
  156. #  else
  157. #    define    STATICPT(func, prott) extern func prott
  158. #   endif
  159. #else
  160. #  define    PROTT(x)    ()
  161. #  ifdef MSC
  162. #    define    STATICPT(func, prott) static func ()
  163. #  else
  164. #    define    STATICPT(func, prott) extern func ()
  165. #   endif
  166. #endif
  167.  
  168. #ifdef    MSC
  169. # define    inportb(port) inp(port)
  170. # define    outportb(port, val) outp(port, val)
  171. #endif
  172.  
  173. #ifdef    __TURBOC__
  174. #  define    REGPKT    struct REGS
  175. #else
  176. #  define    REGPKT    union REGS
  177. #endif
  178.  
  179. #ifdef    DLC
  180. #  define    defined(x)
  181. #  define    inportb        inp
  182. #  define    outportb    outp
  183. #endif
  184.  
  185. #if    !SYMDEB                /* symbolic debugging support    */
  186. #  define    STATIC        static
  187. #endif
  188.  
  189. #if    STARSYS
  190. #  define    exit(x)        dx_exit(x)
  191. #endif
  192.  
  193. /*
  194.  * Define open modes according to selected operating system/compiler.
  195.  */
  196. #if    MSDOS
  197. #  define    OPM_WB        "wb"
  198. #  define    OPM_WT        "wt"
  199. #  define    OPM_RB        "rb"
  200. #  define    OPM_RT        "rt"
  201. #endif
  202.  
  203. #if    UNIX
  204. #  define    OPM_WB        "w"
  205. #  define    OPM_WT        "w"
  206. #  define    OPM_RB        "r"
  207. #  define    OPM_RT        "r"
  208. #endif
  209.  
  210. #if    STARSYS
  211. #  define    OPM_WB        "wb"
  212. #  define    OPM_WT        "wt"
  213. #  define    OPM_RB        "rb"
  214. #  define    OPM_RT        "rt"
  215. #endif
  216.  
  217. #define    TRUE    (1)
  218. #define    FALSE    (0)
  219.  
  220. typedef    unsigned char    uchar;
  221.  
  222. #define tonumber(x)    ((x) - '0')
  223. #define    FOREVER()    for(;;)
  224.  
  225. #endif
  226.